Ext.define('HRMobile.model.Employee', {
    extend: 'Ext.data.Model',
    config: {
     fields: [
              'empNumber',
              'empFirstname',
              'empMiddleName',
              'empLastname',
              'empNickName',
              'empIdCardNum',
              'empIdCardDate',
              'empIdCardPlace',
              'empGender',
              {
            	  name: 'empFullName',
            	  convert: function(value, record) {
            		  return record.get('empLastname') + ' ' + record.get('empMiddleName') + ' ' + record.get('empFirstname');
                  }
              },
              {name: 'fullGender',
            	  convert: function(value, record) {
            		  var fullGender = record.get('empGender');
                      if (fullGender == 1)
                    	  return 'Female';
                      else
                    	  return 'Male';
                  }},
              'empMaritalStatus',
              {name: 'fullMaritalStatus',
                	  convert: function(value, record) {
                		  var fullMaritalStatus = record.get('empMaritalStatus');
                          switch(fullMaritalStatus)
	                          {
	                          case 'SG':
	                            return 'Single';
	                            break;
	                          case 'MR':
	                            return 'Married';
	                            break;
	                          default:
	                        	return 'Other';
	                          	break;
	                          
	                          }
                      }},
              'empNationality',
              'empBirthday',
              'empMilitaryService',
              'empStreet1',
              'empStreet2',
              'empZipcode',
              'empDistrict',
              'empProvince',
              'empHmTelephone',
              'empMobile',
              'empWorkTelephone',
              'empWorkEmail',
              'empOthEmail',
              'empSubUnit',
              'reportingMethod'
              ]
    }
});